package com.graduation.mybatis.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class RecommendationFoodsVO {
    private Long foodId;
    private String foodName;
    private String image;
    private Double grams;
    private Double calories;
    private Double protein;
    private Double fat;
    private Double carbohydrate;
    private Integer mealType; // 添加餐次类型字段


    // 计算实际营养值的方法
    public Double getActualCalories() {
        return grams * calories / 100;
    }

    public Double getActualProtein() {
        return grams * protein / 100;
    }

    public Double getActualFat() {
        return grams * fat / 100;
    }

    public Double getActualCarbohydrate() {
        return grams * carbohydrate / 100;
    }
}
